package com.joseph.websocket.test;

public class CloseableResource implements AutoCloseable {

    private String a;

    @Override
    public void close() throws Exception {
        a = "";
        System.out.println("cloded");
    }

    public void say() {
        a = "";
        System.out.println(a);
    }

    public static void main(String[] args) {
        try (CloseableResource c = new CloseableResource()) {
            c.say();
        } catch (Exception e) {

        }
    }
}
